#include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;


struct edge{
	int s,t;
	double len;
};


struct point{
	double x,y;
	double to(point a){
		return sqrt((x-a.x)*(x-a.x)+(y-a.y)*(y-a.y));
	}
};


bool cmp(edge a,edge b){
	return a.len<b.len;
}


int find(int *f,int x){
	if(f[x] == x) return x;
	return f[x] = find(f,f[x]);
}



int main(){
	int s,p,edge_sum=0;
	double ans=0;
	cin>>s>>p;
	int f[p];
	point node[p];
	edge e[(p*p-p)/2];
	for(int i=0;i<p;i++){
		cin>>node[i].x>>node[i].y;
		f[i] = i;
	}
	int k=0;
	for(int i=0;i<p;i++){
		for(int j=i+1;j<p;j++){
			e[k].s = i;
			e[k].t = j;
			e[k].len = node[i].to(node[j]);
			k++;
		}
	}
	sort(e,e+(p*p-p)/2,cmp);
	for(int i=0;i<(p*p-p)/2;i++){
		if(edge_sum == p-s) break;
		int f1=find(f,e[i].s),f2=find(f,e[i].t);
		if(f1 != f2){
			edge_sum++;
			ans = e[i].len;
			f[f1] = f[f2];
		}
	}
	printf("%.2f",ans);
	return 0;
}
